package com.xuecheng.content.feignClient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author xiao
 * @Date 2024/12/20 09:55
 * @ClassName: MediaServiceClientFallbackFactory
 * @Description: TODO
 */
@Slf4j
@Component
public class MediaServiceClientFallbackFactory implements FallbackFactory<MediaServiceClient> {
    @Override
    public MediaServiceClient create(Throwable throwable) {
        return new MediaServiceClient() {
            @Override
            public String uploadFile(MultipartFile upload, String objectName) {
               log.error("媒体上传文件接口调用失败,文件名:{}",objectName);
               return null;
            }
        };
    }
}
